import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
    	path:'/',
    	name:'Login',
    	meta: {
				title: '',
				key: 0,
				requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
			},
    	component:(resolve)=>require(['./../views/login/Login'],resolve)
    },
    {
    	path:'/home',
    	name:'Home',
    	redirect:{
    		name:'Index'
    	},
    	meta:{
    		key:1,
    		title:'首页',
    		requireAuth:true
    	},
    	component:(resolve)=>{require(['./../views/home/Home'],resolve)},
    	children:[
    		{
    			path:'/index',
    			name:'Index',
    			redirect:{
    				name:'Kongzhitai'
    			},
    			meta:{
    				key:2,
    				title:'首页',
    			},
    			component:(resolve)=>{require(['./../views/home/index/Index'],resolve)},
    			children:[
    				{
    					path:'/kongzhitai',
    					name:'Kongzhitai',
    					meta:{
    						key:3,
    						title:'邮箱',
    					},
    					component:(resolve)=>{require(['./../views/home/index/kongzhitai/Kongzhitai'],resolve)}
    				},
    				{
    					path:'/email',
    					name:'Email',
    					meta:{
    						key:3,
    						title:'邮箱',
    					},
    					component:(resolve)=>{require(['./../views/home/index/email/Email'],resolve)}
    				},
    				{
    					path:'/yonghuguanli',
    					name:'Yonghuguanli',
    					meta:{
    						key:3,
    						title:'用户管理',
    					},
    					component:(resolve)=>{require(['./../views/home/index/yonghuguanli/Yonghuguanli'],resolve)}
    				},
    				{
    					path:'/wenzhangguanli',
    					name:'Wenzhangguanli',
    					meta:{
    						key:3,
    						title:'文章管理',
    					},
    					component:(resolve)=>{require(['./../views/home/index/wenzhangguanli/Wenzhangguanli'],resolve)}
    				},
    				{
    					path:'/treetable',
    					name:'TreeTable',
    					meta:{
    						key:3,
    						title:'文章管理',
    					},
    					component:(resolve)=>{require(['./../views/home/index/TreeTable/TreeTable'],resolve)}
    				},
    				{
    					path:'/HumanResources',
    					name:'HumanResources',
    					meta:{
    						key:3,
    						title:'人力资源组织管理',
    					},
    					component:(resolve)=>{require(['./../views/home/index/HumanResources/HumanResources'],resolve)}
    				},
    				{
    					path:'/yuangongguanli',
    					name:'Yuangongguanli',
    					meta:{
    						key:3,
    						title:'员工管理',
    					},
    					component:(resolve)=>{require(['./../views/home/index/Yuangongguanli/Yuangongguanli'],resolve)}
    				},
    				{
    					path:'/AddButton',
    					name:'AddButton',
    					meta:{
    						key:3,
    						title:'添加员工管理表单',
    					},
    					component:(resolve)=>{require(['./../views/home/index/Yuangongguanli/AddButton'],resolve)}
    				}
    			]
    		},
    		
    		{
    			path:'/my',
    			name:'My',
    			meta:{
    				key:4,
    				title:'我的处理中心',
    			},
    			component:(resolve)=>{require(['./../views/home/my/My'],resolve)},
    			children:[
    				
    			]
    		}
    		
    	]
    },
    
    
    
  ]
})
